package server;

import java.rmi.Naming;
import java.rmi.RMISecurityManager;
import java.rmi.registry.LocateRegistry;
import controlador.Sistema;
import rmi.InterfazRemotaCPR;
import rmi.InterfazRemotaOF;

public class Server {

	public static void main(String[] args)
	{
		new Server();
				
	}
	
	public Server() {
    	try {
    		//LocateRegistry.getRegistry();
    		LocateRegistry.createRegistry(1099);
    		InterfazRemotaCPR CPR = Sistema.getInstancia();
    		Naming.rebind ("//localhost/CPR", CPR);
    		System.out.println("Fijado en //localhost/CPR");
    		InterfazRemotaOF OF = Sistema.getInstancia();
    		Naming.rebind ("//localhost/OF", OF);
            System.out.println("Fijado en //localhost/OF");

    
		} catch (Exception e) {
			e.printStackTrace();
		};
	}
	
}
